-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-10167: [Rust] [DataFusion] Support DictionaryArray in sql.rs tests, by using standard pretty printer #8333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0b2dd5c to
9d22a54
Compare
rust/datafusion/tests/sql.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a pretty good example of the change in structure.
rust/arrow/src/util/pretty.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this type was missing in pretty.rs (I found it while converting the tests in sql.rs).
rust/datafusion/tests/sql.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did cheat somewhat here and punt on adding proper ListArray support to pretty.rs.
9d22a54 to
da3aec1
Compare
andygrove
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alamb this is a nice cleanup of the tests.
jorgecarleitao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice, @alamb . LGTM
|
@alamb we need a small rebase to merge. |
…sts, by using standard pretty printer
da3aec1 to
177c6ce
Compare
|
@jorgecarleitao FYI rebased |
This PR removes (most of) the special case pretty printing code in DataFusion's sql integration test,
sql.rsin favor of the standard pretty printer inarrow::utils::prettyand in the process adds support for DictionaryArray printing as well as standardizing how tests are run and output is compared.I am working on adding support for
DictionaryArrayin DataFusion (and thus want to add tests to sql.rs). This specific PR's changes are larger than strictly necessary, but I felt it made it easier to write new tests in sql.rs. However, if people prefer, I could instead add a special case forDictionaryArrayinarray_strand accomplish my goal with a much smaller PRNote: I found that using
Vec<Vec<String>>to encode expected results rather than aStringretains the nice property that differences to expected output are shown reasonably in the test output. For example: